<!DOCTYPE html>
<html>
<head>
<title>专栏列表</title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.columnName" @keyup.enter="query" placeholder="专栏名称">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			#if($shiro.hasPermission("cms:specialColumnContent:save"))
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			#end
		</div>
	    
	    <div class="row">
            <div v-for="(item, index) in itemList" class="col-md-3 col-sm-12">
                <div class="thumbnail no-margin-bottom">
                    <img :src="item.columnContentLogo" class="img-responsive">
                    <div class="caption">
                        <h3 id="thumbnail-label">{{item.columnContentTitle}}<a class="anchorjs-link" href="#thumbnail-label"><span class="anchorjs-icon"></span></a></h3>
                        <p>{{item.columnContent}}</p>
                        <p><a @click="update(item.id)" class="btn btn-primary" role="button">修改</a> <a @click="del(item.id,index)" class="btn btn-default" role="button">删除</a></p>
                    </div>
                </div>
            </div>
            
        </div>
	    
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal" style="width: 80%;">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">专栏名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="specialColumn.columnName" placeholder="专栏名称"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">专栏介绍</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="specialColumn.columnDesc" placeholder="专栏介绍"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">专栏logo</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="specialColumn.columnLogo" placeholder="专栏logo"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">专栏内容</div>
			   	<div class="col-sm-10">
			      <div id="flyrayEdt">
				     <p></p>
				   </div>
			    </div>
			</div>
			
		    <button type="button" id="btn1">btn1 Click Me!</button>
			<button type="button" id="btn2">btn2 Click Me!</button>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
    $(function () {
    	var E = window.wangEditor
    	var editor = new E('#flyrayEdt')
    	// 下面两个配置，使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用！！！
        editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
        editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
       	// 隐藏“网络图片”tab
        editor.customConfig.showLinkImg = false
        editor.create()
        document.getElementById('btn1').addEventListener('click', function () {
        	// 读取 html
        	console.log(editor.txt.html())
        	alert(editor.txt.html())
    	}, false)

    	document.getElementById('btn2').addEventListener('click', function () {
        	// 读取 text
        	alert(editor.txt.text())
    	}, false)
    });
</script>
<script src="${rc.contextPath}/js/cms/special_column_content.js?_${date.systemTime}"></script>
</body>
</html>